/*
  请求地址:http://wthrcdn.etouch.cn/weather_mini
  请求方法:get
  请求参数:city(城市名)
  响应内容:天气信息

  1. 点击回车
  2. 查询数据
  3. 渲染数据
  */
var app = new Vue({
	el: "#app", 
	data: {
		city:"",
		ws:[],
		ganmao:"",

	},
	methods: { 
		f1: function() {
			 axios.get("http://wthrcdn.etouch.cn/weather_mini?city="+this.city)
			 .then(response=>{
				 console.log(response);
				 this.ws=response.data.data.forecast;
				 response.data.data.yesterday.fengxiang=response.data.data.yesterday.fx;
				 response.data.data.yesterday.fengli=response.data.data.yesterday.fl;
				 //console.log(response.data.data.wendu);
				 //console.log(response.data.data.yesterday.fx);
				 //console.log(response.data.data.forecast[0].type);
				 //console.log(response.data.data.forecast);
				 this.ws.unshift(response.data.data.yesterday);
				 this.ganmao = "注意：" + response.data.data.ganmao;
				//  console.log(response.data.data.ganmao);
				 
			 }) 
		},
		f2:function(city){
			this.city=city;
			this.f1();
		}






	}
})